<?php 
require_once "class.db.php";
class yahoo extends db{
	
	function Yahoo_List($loai='',$offset=-1,$limit=-1 ){
		$sql = "SELECT * FROM yahoo WHERE 
                (loai = '$loai' OR '$loai' = '')  ORDER BY idYahoo ASC ";
		if($limit > 0 && $offset >=0 ) $sql.= " LIMIT $offset,$limit";	
		$rs = mysql_query($sql) or die(mysql_error());
		return $rs;
	}	
	function Yahoo_ChiTiet($idYahoo){
		$sql = "SELECT * FROM yahoo WHERE idYahoo = $idYahoo";
		$rs = mysql_query($sql);
		return $rs;
	}	
	function Yahoo_Sua($idYahoo){
		
		$Ten = $this->processData($_POST[Ten]);		
		$dienthoai = $this->processData($_POST[dienthoai]);
		
		$sql = "UPDATE yahoo SET Ten = '$Ten',dienthoai = '$dienthoai' WHERE  idYahoo = $idYahoo";
		mysql_query($sql);
	}
	function Yahoo_Them(){
		$loai = $this->processData($_POST[loai]);		
		$Ten = $this->processData($_POST[Ten]);		
		$dienthoai = $this->processData($_POST[dienthoai]);
		
		$sql = "INSERT INTO yahoo VALUES(NULL,'$Ten','$dienthoai','$loai')";
		mysql_query($sql);
	}	
 
		
}

?>